﻿// <copyright file="AnimationHelper.cs" company="Ucaya">
// </copyright>
// <author>Ucaya</author>

namespace KinectExtensions.Helpers
{
    #region

    using System;
    using System.Windows;

    #endregion

    /// <summary>
    ///   TODO: Update summary.
    /// </summary>
    public class AnimationHelper
    {
        // Using a DependencyProperty as the backing store for Duration.  This enables animation, styling, binding, etc...

        #region Constants and Fields

        /// <summary>
        ///   The duration property.
        /// </summary>
        public static readonly DependencyProperty DurationProperty = DependencyProperty.RegisterAttached("Duration", typeof(TimeSpan), typeof(AnimationHelper), new PropertyMetadata(DurationChangedCallback));

        /// <summary>
        ///   The value property.
        /// </summary>
        public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached("Value", typeof(object), typeof(AnimationHelper), new PropertyMetadata(ValueChangedCallback));

        #endregion

        #region Public Methods

        /// <summary>
        ///   The get duration.
        /// </summary>
        /// <param name = "obj">
        ///   The obj.
        /// </param>
        /// <returns>
        /// </returns>
        public static TimeSpan GetDuration(DependencyObject obj)
        {
            return (TimeSpan)obj.GetValue(DurationProperty);
        }

        /// <summary>
        ///   The get value.
        /// </summary>
        /// <param name = "obj">
        ///   The obj.
        /// </param>
        /// <returns>
        ///   The get value.
        /// </returns>
        public static object GetValue(DependencyObject obj)
        {
            return obj.GetValue(ValueProperty);
        }

        /// <summary>
        ///   The set duration.
        /// </summary>
        /// <param name = "obj">
        ///   The obj.
        /// </param>
        /// <param name = "value">
        ///   The value.
        /// </param>
        public static void SetDuration(DependencyObject obj, TimeSpan value)
        {
            obj.SetValue(DurationProperty, value);
        }

        /// <summary>
        ///   The set value.
        /// </summary>
        /// <param name = "obj">
        ///   The obj.
        /// </param>
        /// <param name = "value">
        ///   The value.
        /// </param>
        public static void SetValue(DependencyObject obj, object value)
        {
            obj.SetValue(ValueProperty, value);
        }

        #endregion

        #region Methods

        /// <summary>
        ///   The duration changed callback.
        /// </summary>
        /// <param name = "d">
        ///   The d.
        /// </param>
        /// <param name = "e">
        ///   The e.
        /// </param>
        private static void DurationChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
        }

        // Using a DependencyProperty as the backing store for Value.  This enables animation, styling, binding, etc...

        /// <summary>
        ///   The value changed callback.
        /// </summary>
        /// <param name = "d">
        ///   The d.
        /// </param>
        /// <param name = "e">
        ///   The e.
        /// </param>
        private static void ValueChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
        }

        #endregion
    }
}